﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace LongSCADA_WPF.UseControlS
{
    /// <summary>
    /// PaginationControl.xaml 的交互逻辑
    /// </summary>
    public partial class PaginationControl : UserControl
    {
        public PaginationControl()
        {
            InitializeComponent();
        }

        //附加属性--与前台绑定

        /// <summary>
        /// propdp 自动挂接到前台的相应属性
        /// </summary>
        public int CurrentPage
        {
            get { return (int)GetValue(CurrentPageProperty); }
            set { SetValue(CurrentPageProperty, value); }
        }

        // Using a DependencyProperty as the backing store for CurrentPage.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty CurrentPageProperty =
            DependencyProperty.Register("CurrentPage", typeof(int), typeof(PaginationControl), new PropertyMetadata(1));


        public int TotalPages
        {
            get { return (int)GetValue(TotalPagesProperty); }
            set { SetValue(TotalPagesProperty, value); }
        }

        // Using a DependencyProperty as the backing store for TotalPages.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty TotalPagesProperty =
            DependencyProperty.Register("TotalPages", typeof(int), typeof(PaginationControl), new PropertyMetadata(1));


        /// <summary>
        /// 命令：首页
        /// </summary>
        public ICommand GotoFirstPageCommand
        {
            get { return (ICommand)GetValue(GotoFirstPageCommandProperty); }
            set { SetValue(GotoFirstPageCommandProperty, value); }
        }

        // Using a DependencyProperty as the backing store for GotoFirstPageCommand.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty GotoFirstPageCommandProperty =
            DependencyProperty.Register("GotoFirstPageCommand", typeof(ICommand), typeof(PaginationControl));


        /// <summary>
        /// 命令：上一页
        /// </summary>
        public ICommand GotoPreviousPageCommand
        {
            get { return (ICommand)GetValue(GotoPreviousPageCommandProperty); }
            set { SetValue(GotoPreviousPageCommandProperty, value); }
        }

        // Using a DependencyProperty as the backing store for GotoPreviousPageCommand.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty GotoPreviousPageCommandProperty =
            DependencyProperty.Register("GotoPreviousPageCommand", typeof(ICommand), typeof(PaginationControl));


        /// <summary>
        /// 命令：下一页
        /// </summary>
        public ICommand GotoNextPageCommand
        {
            get { return (ICommand)GetValue(GotoNextPageCommandProperty); }
            set { SetValue(GotoNextPageCommandProperty, value); }
        }

        // Using a DependencyProperty as the backing store for GotoNextPageCommand.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty GotoNextPageCommandProperty =
            DependencyProperty.Register("GotoNextPageCommand", typeof(ICommand), typeof(PaginationControl));

        /// <summary>
        /// 命令：最后一页
        /// </summary>
        public ICommand GotoLastPageCommand
        {
            get { return (ICommand)GetValue(GotoLastPageCommandProperty); }
            set { SetValue(GotoLastPageCommandProperty, value); }
        }

        // Using a DependencyProperty as the backing store for GotoLastPageCommand.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty GotoLastPageCommandProperty =
            DependencyProperty.Register("GotoLastPageCommand", typeof(ICommand), typeof(PaginationControl));



    }
}
